#include<stdio.h> 
#include<math.h> 
#include<stdlib.h>
#include <time.h>


void main(){
	int i,n;
	int norm=0, mimo=0;
	double  x, y ;
	double Pi;
	srand(time(0));
	
	printf("vvedite kolichestvo rasmatrivaemuh tochek\n");
	scanf("%d", &n);

	for (i = 0; i < n; i ++){
			x=rand();
			y=rand();
		
		if (x*x + y*y <= RAND_MAX*RAND_MAX)
			norm++;
		else 
			mimo++;
		}		
		Pi = (double) 4 * norm / n;
		printf("Pi = %f\n", Pi);
		system("pause");
	}